lib/pull: Avoid calling destroy on unref'ed GSource
authorJonathan Lebon <jonathan@jlebon.com>
Wed, 23 Oct 2019 15:04:00 +0000 (11:04 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Wed, 23 Oct 2019 15:15:02 +0000 (11:15 -0400)
commitd4a186e80e139b366c527d6398173bd1a80c7c0b
treecb6a918a4a7ce0fe99c546bd0df8fbb101def76e
parentf333ae74f4a06dc537315d52959714a79be464c7
lib/pull: Avoid calling destroy on unref'ed GSource

We're creating the timer source and then passing ownership to the
context, but because we didn't free the pointer, we would still call
`g_source_destroy` in the exit path. We'd do this right after doing
`unref` on the context too, which would have already destroyed and
unref'ed the source.

Drop that and just restrict the scope of that variable down to make
things more obvious.

Just noticed this after reviewing #1953.
src/libostree/ostree-repo-pull.c